﻿using Microsoft.Practices.Prism.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;

namespace WebServerConnectorDll
{
    public class CPersonnelGroupPermission : NotificationObject, IFruitClass
    {
        private int uid;
        private int personnelGroupUID;
        private String permissionUID;

        [DataMember(Order = 0)]
        public int UID
        {
            get
            {
                return uid;
            }
            set
            {
                uid = value;
                RaisePropertyChanged("UID");
            }
        }

        [DataMember(Order = 1)]
        public int PersonnelGroupUID
        {
            get
            {
                return personnelGroupUID;
            }
            set
            {
                personnelGroupUID = value;
                RaisePropertyChanged("PersonnelGroupUID");
            }
        }

        [DataMember(Order = 2)]
        public String PermissionUID
        {
            get
            {
                return permissionUID;
            }
            set
            {
                permissionUID = value;
                RaisePropertyChanged("PermissionUID");
            }
        }

        public CPersonnelGroupPermission()
        {
            
        }

        public CPersonnelGroupPermission(int pPersonnelGroupUID, String pPermissionUID)
        {
            PersonnelGroupUID = pPersonnelGroupUID;
            PermissionUID = pPermissionUID;
        }

        public String ToInsertString()
        {
            return PersonnelGroupUID + "-" + PermissionUID;
        }

        public String ToUpdateString()
        {
            return "PersonnelGroupUID=" + PersonnelGroupUID + ",PermissionUID=" + PermissionUID;
        }
    }
}
